package com.tang.imgupload.service.impl;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.tang.imgupload.commen.Constant;
import com.tang.imgupload.service.IIvokePyService;
import com.tang.imgupload.util.RabbitMQUtil;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class InvokePyService implements IIvokePyService {
	@Resource
	RabbitMQUtil rabbitMQ;

	/**
	 * 发送消息服务
	 *
	 * @param data 消息
	 */
	@Override public boolean invokeSRCNN(Object data){

		try {
			rabbitMQ.send(data, Constant.RABBIT_MQ.EXCHANG_SR.getValue(), Constant.RABBIT_MQ.QUEUE_SRCNN.getValue());
		} catch (JsonProcessingException e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}
}
